import request from "@/utils/request";

/**
 * @description 列表
 * @param params
 * @returns {*}
 */
export function list(params){
    return request({
        url:'/tenantRelationship/admin/getTenantRelationship',
        method:'GET',
        params
    })
}
/**
 * @description 新增/编辑
 * @param data
 * @returns {*}
 */
export function save(data){
    return request({
        url:'/tenantRelationship/admin/saveTenantRelationship',
        method:'POST',
        data
    })
}

/**
 * @description 承租人详情
 * @param id
 * @returns {*}
 */
export function detail(id){
    return request({
        url:'/tenantRelationship/admin/getTenantRelationshipByUniqueId',
        method:'GET',
        params:{id}
    })
}

/**
 * @description 删除
 * @param id
 * @returns {*}
 */
export function deleteRow(id){
    return request({
        url:'/tenantRelationship/admin/deleteTenantRelationship',
        method:'GET',
        params:{id}
    })
}

/**
 * @description 根据唯一标识获取租赁关系
 * @param uniqueId
 * @returns {*}
 */
export function  getTenantRelationshipById(uniqueId){
    return request({
        url:'/tenantRelationship/admin/getTenantRelationshipById',
        method:'GET',
        params:{uniqueId}
    })
}

/**
 * @description 房屋管理中新增/编辑承租人信息
 * @param data
 * @returns {*}
 */
export function saveTenantRelationship(data){
    return request({
        url:'/tenantRelationship/admin/saveTenantRelationship',
        method:'POST',
        data
    })
}

/**
 * @description 承租人管理中新增/编辑房屋信息
 * @param data
 * @returns {*}
 */
export function addTenantRelationshipFwInfo(data){
    return request({
        url:'/tenantRelationship/admin/addTenantRelationshipFwInfoJoin',
        method:'POST',
        data
    })
}


/**
 * @description 列表(用于房屋选择承租人用)
 * @param params
 * @returns {*}
 */
export function listNew(params){
    return request({
        url:'/tenantRelationship/admin/getTenantRelationshipNew',
        method:'GET',
        params
    })
}

